/*
 * imx8-capture.h
 *
 *  Created on: 2024年3月12日
 *      Author: NI
 */

#ifndef TEST_TP2855_IMX8_CAPTURE_IMX8_CAPTURE_H_
#define TEST_TP2855_IMX8_CAPTURE_IMX8_CAPTURE_H_

#include <sys/platform.h>
#include <vcapture/capture.h>

typedef struct _capture_api {
	int (*capture_create_buffers)(capture_context_t context, uint32_t property);
	capture_context_t (*capture_create_context)(uint32_t flags);
	void (*capture_destroy_context)(capture_context_t context);
	int (*capture_get_frame)(capture_context_t context, uint64_t timeout, uint32_t flags);
	int (*capture_get_property_i)(capture_context_t context, uint32_t prop, int32_t *value);
	int (*capture_get_property_p)(capture_context_t context, uint32_t prop, void **value);
	int (*capture_is_property)(capture_context_t context, uint32_t prop);
	int (*capture_put_buffer)(capture_context_t ctx, uint32_t idx, uint32_t flags);
	int (*capture_release_frame)(capture_context_t context, uint32_t idx);
	int (*capture_set_property_i)(capture_context_t context, uint32_t prop, int32_t value);
	int (*capture_set_property_p)(capture_context_t context, uint32_t prop, void *value);
	int (*capture_update)(capture_context_t context, uint32_t flags);
	int (*capture_get_reg)(capture_context_t context, uint32_t page, uint32_t reg, uint32_t* data);
} capture_api_t;

extern void *handle;
//extern int soc_capture_init(char * path);
extern int capture_get_device_api1(const char *lib_name, int dev_type, capture_api_t *api);
#endif /* TEST_TP2855_IMX8_CAPTURE_IMX8_CAPTURE_H_ */
